package com.kyzh.core.dialog

import android.content.Context
import android.view.Gravity
import android.view.LayoutInflater
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.kyzh.core.R
import com.kyzh.core.databinding.DialogInstallBinding

private var dialog : BottomSheetDialog?=null
fun Context.showInstallDialog( listener: ()->Unit){

    dialog = BottomSheetDialog(this,R.style.BDAlertDialog1)
    dialog?.setContentView(getView(listener))
    dialog?.setCanceledOnTouchOutside(false)
    dialog?.show()
}
private fun Context.getView( listener: ()->Unit) = DialogInstallBinding.inflate(LayoutInflater.from(this)).apply {
    tv2.setOnClickListener {
        listener()
        dialog?.dismiss()
    }
}.root
